# -*- coding: utf-8 -*- 
# 作者:飞虎
# 开发时间:2022/5/14 22:03
from PyQt5.Qt import *


class Window(QWidget):
	def __init__(self):
		super().__init__()
		self.setWindowTitle('QLabel学习')
		self.resize(500, 500)
		self.setup_ui()

	def setup_ui(self):
		# label=QLabel('社会飞虎哥,人狠话不多',self)
		# label=QLabel('账号(&S)',self)
		label=QLabel('<a href="http://www.itlike.com">撩课</a>',self)
		# label = QLabel('123 456 789' * 6, self)
		label.setStyleSheet('background-color:cyan')
		label.move(100, 100)
		label.resize(300, 300)
		# label.adjustSize()

		# label.setAlignment(Qt.AlignRight | Qt.AlignVCenter)
		# label.setAlignment(Qt.AlignRight)
		# label.setIndent(20)

		label.setMargin(20)

		# label.setTextFormat(Qt.PlainText)
		# label.setTextFormat(Qt.RichText)

		# le1 = QLineEdit(self)
		# le1.move(250,250)
		#
		# le2=QLineEdit(self)
		# le2.move(250,300)

		# label.setBuddy(le1)

		# label.setPixmap(QPixmap('rose.png'))
		# label.adjustSize()
		# label.setScaledContents(True)

		# label.setTextInteractionFlags(Qt.TextSelectableByMouse | Qt.TextSelectableByKeyboard | Qt.TextEditable)
		# label.setSelection(1,2)

		# label.setOpenExternalLinks(True)
		# label.setWordWrap(True)

		# label.setText("<img src='rose.png' width=60 height=60>")

		# label.setNum(888.88)

		# pic = QPicture()
		# painter = QPainter(pic)
		# painter.setBrush(QBrush(QColor(100, 200, 100)))
		# painter.drawEllipse(0, 0, 200, 200)
		#
		# label.setPicture(pic)
		# movie=QMovie('shulan.gif')
		# label.setMovie(movie)
		#
		# movie.start()
		# movie.setSpeed(1000)

		# label.linkHovered.connect(lambda a:print(a))
		label.linkActivated.connect(lambda a:print(a))


if __name__ == '__main__':
	import sys

	app = QApplication(sys.argv)
	window = Window()
	window.show()
	sys.exit(app.exec_())
